<?php
/*
Overmundo, cultura de todo o Brasil
Desenvolvido pela Tecnopop para o Núcleo de Idéias Movimento
Copyright (C) 2006  Núcleo de Idéias Movimento

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/


$nivelPagina = "cadastrado";
$secaoAtual = "agenda";
include('../lib/checa_login.php');

 
require_once('../lib/class.site.php');
require_once('../lib/class.overmundo.php');
require_once('../lib/class.conecta.php');
require_once("../lib/class.usuario.php");
require_once("../lib/class.evento.php");
require_once("../lib/class.comentario_evento.php");

session_start();
if (!isset($minhaConexao))  {
	$minhaConexao = new Conecta();
}
if (!isset($meuSite)) {
	$meuSite = new Overmundo();
}

if (!isset($meuSite->linkid)) { 
	$meuSite->linkid = $minhaConexao->linkid;
}

if ($codigo = $meuSite->LimpaCampo($_GET["util"])) { 
 	$thisComentario = new ComentarioEvento($meuSite->linkid, $codigo);
 	$thisComentario->Opina("util", $usuarioLogado->PegaCodUsuario()); 
}

if ($codigo = $meuSite->LimpaCampo($_GET["inutil"])) { 
 	$thisComentario = new ComentarioEvento($meuSite->linkid, $codigo);
 	$thisComentario->Opina("inutil", $usuarioLogado->PegaCodUsuario()); 
}

if ($codigo = $thisComentario->PegaCodEvento()) {
	header("location: ../agenda/evento.php?evento=$codigo");
	exit;
} else {
	//die("3");
	header("location: ../agenda");
	exit;
}

	 	
		
?>